import React, { PureComponent } from 'react'
import Son from './components/Son';

export default class App extends PureComponent {
    state = {
        count:1
    }
    componentDidMount(){
        console.log('app componentDidMount')
    }
    render() {
        console.log('app render')
        let {count} = this.state;
        return (
            <div>
                <p>app state count: {count}</p>
                <p><button onClick={()=>{
                    this.setState({
                        count:count + 1
                    })
                }}>count++</button></p>
                <p><button onClick={()=>{
                    this.setState({
                        count:2
                    })
                }}>count + =》 2</button></p>

                <hr />
                <Son count={count}/>
            </div>
        )
    }
}
